<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			#lanqiu{
				position: absolute;
				margin: 780px 0 0 0;
			}
			hr{
				width: 2000px;
				color: #000;
				position: absolute;
				bottom: 90px;
			}
		</style>
	</head>
	<body>
		<button type="button" id="btn">开始</button>
		<img id="lanqiu" src="img/篮球.png" >
		<hr >
		<script src="js/jquery-3.4.1.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function(){
				var a = 800;
				$("#btn").on("click",function(){
					var b = setInterval(function(){
						a -= 20;
						$("#lanqiu").animate({
							"bottom":"+="+a+"px"
						},400,).animate({
							"bottom":"-="+a+"px"
						},400);
						if(a <= 0){
							clearInterval(b);
							a = 800;
						};
					},10)
				});
				
			});
		</script>
	</body>
</html>
